package com.course.controller;

import com.course.component.http.Crp;
import com.course.dto.reqs.RequestPermission;
import com.course.masterservice.PermissionMasterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Copyright: Copyright (c)  林中小鸟  All rights reserved.
 * @author: moon
 * @date: 2022/9/20 11:13
 * @Description: **********************
 */
@RestController
@RequestMapping(value = "/x/permission")
public class PermissionController {

    @Autowired
    private PermissionMasterService permissionMasterService;

    @GetMapping("list")
    public Crp list(RequestPermission requestPermission){
        return Crp.success(permissionMasterService.list(requestPermission));
    }

    @DeleteMapping("del")
    public Crp del(@RequestBody RequestPermission requestPermission){
        return Crp.success(permissionMasterService.del(requestPermission));
    }

    @PostMapping("edit")
    public Crp edit(@RequestBody  RequestPermission requestPermission){
        return Crp.success(permissionMasterService.update(requestPermission));
    }

}
